﻿using JV.Com.Model;
using Microsoft.Practices.Prism.StoreApps;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JV.Com.ViewModels.Wrapper
{
    public sealed class GameMetadataWrapper : ViewModel
    {
        public static IEnumerable<GameMetadataWrapper> GetMetadata(DetailGamePageViewModel parent, Game game)
        {
            yield return new GameMetadataWrapper(parent) { Caption = "Date de sortie", Value = game.ReleaseDate };
            yield return new GameMetadataWrapper(parent) { Caption = "Editeur", Value = game.Editor };
            yield return new GameMetadataWrapper(parent) { Caption = "Développeur", Value = game.Developer };
            yield return new GameMetadataWrapper(parent) { Caption = "Type", Value = game.Type };
            yield return new GameMetadataWrapper(parent) { Caption = "Support", Value = game.Support };
            yield return new GameMetadataWrapper(parent) { Caption = "Multi-joueurs", Value = game.Multiplayer.HasValue ? (game.Multiplayer.Value ? "Oui" : "Non") : null };
            yield return new GameMetadataWrapper(parent) { Caption = "Version", Value = game.Version };
            yield return new GameMetadataWrapper(parent) { Caption = "Classification", Value = game.ReleaseDate };
        }

        private readonly DetailGamePageViewModel m_parent;
        public GameMetadataWrapper(DetailGamePageViewModel parent)
        {
            m_parent = parent;
        }

        public string Caption { get; set; }
        public string Value { get; set; }
    }
}
